<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>内边距属性</title>
    <style type="text/css">
    .border{border:5px solid #ccc;}      /*为图像和段落设置边框*/
    img{
        padding:80px;                       /*图像4个边的内边距相同*/
        padding-bottom:0;                  /*单独设置下边的内边距*/
    }        
    p{padding:5%;}                         /*段落内边距为父元素宽度的5%*/
    </style>
</head>
<body>
    <img class="border" src="images/padding_in.png" alt="内边距" />
    <p class="border">段落内边距为父元素宽度的5%。</p>
</body>
</html>
